package com.hymall.service.admin;

import com.hymall.bean.vo.DashboardVO;
import com.hymall.mapper.MarketDashboardMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: 徐成喜
 * @description 用户首页显示
 * @date: 2022/7/15 20:33
 */
@Service
public class DashboardServiceImpl implements DashboardService {
    @Autowired
    MarketDashboardMapper dashboardMapper;

    @Override
    public DashboardVO dashboard() {
        Integer totalGoods = dashboardMapper.queryTotalGoods();
        Integer totalUser = dashboardMapper.queryTotalUser();
        Integer totalProduct = dashboardMapper.queryTotalProduct();
        Integer totalOrder = dashboardMapper.queryTotalOrder();
        DashboardVO dashboardVO = new DashboardVO();
        dashboardVO.setGoodsTotal(totalGoods);
        dashboardVO.setOrderTotal(totalOrder);
        dashboardVO.setProductTotal(totalProduct);
        dashboardVO.setUserTotal(totalUser);



        return dashboardVO;
    }
}
